# @Version:1.0
# @Author：green-citrus

# class Student:
#     name = None
#     age = None
#     __score = None
#
#     def __init__(self, name, age):
#         self.name = name
#         self.age = age
#
#     def show_info(self):
#         print(f"name={self.name}, age={self.age}")
#
#     def set_score(self, score):
#         self.__score = score
#
# # 小学生类
# class Pupil(Student):
#     def testing(self):
#         print("...小学生在考小学数学")
#
# # 大学生类
# class Graduate(Student):
#     def testing(self):
#         print("...大学生在考高等数学")
#
# stu1 = Pupil("apple", 10)
# stu1.testing()
# stu1.set_score(80)
# stu1.show_info()
#
# print('-'*30)
# stu2 = Graduate("grape", 22)
# stu2.testing()
# stu2.set_score(100)
# stu2.show_info()

# Python支持多重继承
class A:
    n1 = 100

    def sing(self):
        print("A sing()...", self.n1)

class B:
    n2 = 200
    n1 = 300

    def dance(self):
        print("B dance()...", self.n2)

    def sing(self):
        print("B sing()...", self.n1)

# C类继承了A类和B类
# 注意：在多重继承中，如果有同名的成员，遵守从左到右的继承优先级
# （即：写左边的父类优先级高，写在右边的父类优先级低)
class C(B, A):
    # Python pass 是空语句，是为了保持程序结构的完整性。
    # pass 不做任何事情，一般用做占位语句
    pass

c = C()
print('-'*20)
print(f"属性信息 {c.n1} {c.n2}") # 300 200
# 调用继承方法
c.dance() # B dance()... 200
c.sing() # B sing()... 300

